package org.sg20.pagerank.pagerankviewer;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class PageRankViewerPartitioner extends Partitioner<DecFloatWritable, Text> {
    @Override
    public int getPartition(DecFloatWritable key, Text value, int numReduceTasks) {
        float keyVal = key.get();
        float division = 1/numReduceTasks;
        return (int)(keyVal/division) + 1;
    }
}
